<?php
use common\service\StaticService;
use backend\assets\AdminAsset;
use common\service\GlobalUrlService;
use common\service\CommonService;
$this->title = '订单详情';

StaticService::includeAppCssStatic(GlobalUrlService::buildStaticUrl('/css/uniform/css/uniform.default.css'),AdminAsset::class);
?>

<form class="layui-form">
    <div class="layui-card">
        <div class="layui-card-header">订单详情</div>
        <div class="layui-card-body">
            <div class="layui-form-item">
                <h2>订单信息</h2>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单编号</label>
                <label class="layui-form-label label-left"><?= $data['order_no']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单状态</label>
                <label class="layui-form-label label-left"><?php echo CommonService::getOrderStatus($data['order_status']);?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">类型</label>
                <label class="layui-form-label label-left"><?php if($data['order_type'] ==1){echo '团购';}else{echo '单独购买';}?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">运单号</label>
                <label class="layui-form-label label-left"><?= $data['transport_no']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">流水号</label>
                <label class="layui-form-label label-left"><?= $data['serial_no']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">下单时间</label>
                <label class="layui-form-label label-left"><?= date('Y-m-d H:i:s',$data['created_time'])?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">完成时间</label>
                <label class="layui-form-label label-left"><?php if(empty($data['complete_time'])):else:echo date('Y-m-d H:i:s',$data['complete_time']); endif;?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单金额</label>
                <label class="layui-form-label label-left"><?= $data['order_money']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">支付时间</label>
                <label class="layui-form-label label-left"><?= !empty($data['pay_time']) ? date('Y-m-d H:i:s',$data['pay_time']) :''?></label>
            </div>
            <div class="layui-form-item">
                <h2>用户信息</h2>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">收货人</label>
                <label class="layui-form-label label-left"><?= $data['addressee_name']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">收货地址</label>
                <label class="layui-form-label label-left"><?= $data['province'].' '.$data['city'].' '. $data['county'].' '. $data['address']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <label class="layui-form-label label-left"><?= $data['addressee_phone']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">订单备注</label>
                <label class="layui-form-label label-left"><?= $data['remark']?></label>
            </div>
            <div class="layui-form-item">
                <h2>商品信息</h2>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">店铺ID</label>
                <label class="layui-form-label label-left"><?= $data['shop_id']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">店铺名称</label>
                <label class="layui-form-label label-left"><?= $data['shop_name']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">sku</label>
                <label class="layui-form-label label-left"><?= $data['sku']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">商品数量</label>
                <label class="layui-form-label label-left"><?= $data['goods_num']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">活动名称</label>
                <label class="layui-form-label label-left"><?= $data['activity_name']?></label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><?php if($data['order_type'] == 1):?>团员<?php else:?>头像<?php endif;?></label>
                <div class="layui-inline">
                    <ul class="menber">
                        <?php foreach ($users as $user):?>
                        <li>
                            <img src="<?= $user['avatarurl']?>">
                        </li>
                        <?php endforeach;?>
                    </ul>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <a class="layui-btn layui-btn-primary" onclick="window.history.go(-1);">返回</a>
                </div>
            </div>
        </div>
    </div>
</form>


<style>
    .layui-form-label{width:140px;}
    .layui-input-block {margin-left: 185px;width:50%;}
    .label-pic{margin-left:15px;}
    .label-left{text-align:left;}
    .complaintpic{width:170px;height:170px;}
    .layui-inline ul{height:40px;}
    .layui-inline ul li{height:100%;width:40px;display:inline-block;}
</style>